/*
 * Powered By newdev
 * Since 2020
 */

package com.xy.biz.auth.manager.impl;

import com.xy.biz.auth.dao.UserPasswordDao;
import com.xy.biz.auth.domain.bo.UserPasswordBO;
import com.xy.biz.auth.domain.converter.UserPasswordConverter;
import com.xy.biz.auth.manager.UserPasswordManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 * 
 * @author zsp
 * @date 2020-6-11
 */
@Service
public class UserPasswordManagerImpl implements UserPasswordManager {

	@Autowired
	private UserPasswordDao userPasswordDao;
	
	@Override
	public int saveUserPassword(UserPasswordBO userPasswordBO) {
		return userPasswordDao.saveUserPassword(UserPasswordConverter.toPO(userPasswordBO));
	}
	
	@Override
	public int updateUserPassword(UserPasswordBO userPasswordBO) {
		return userPasswordDao.updateUserPassword(UserPasswordConverter.toPO(userPasswordBO));
	}
	
	@Override
	public UserPasswordBO getUserPassword(Long userId) {
		return UserPasswordConverter.fromPO(userPasswordDao.getUserPassword(userId));
	}
	
}
